package edu.zut.dao;

import edu.zut.util.DBUtil;

import java.sql.ResultSet;
import java.sql.SQLException;

//关于用户模块的数据层操作：JDBC操作等
public class UserDao {

    //根据用户名和密码的登录操作
    public boolean loginQuery(String user_name, String user_psw) {

        String sql = "select * from sys_user where user_name=? and user_password=?";
        ResultSet rs = DBUtil.query(sql, user_name, user_psw);
        boolean flag = false;
        try {
            if (rs.next()){
                flag = true;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return flag;
    }


}
